﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class CreateQRCode : MonoBehaviour {

    public Image qrCodeImage;
    public string content;
    public Texture2D texture;

    private void Start()
    {
        int wigth = (int)qrCodeImage.rectTransform.sizeDelta.x;
        int height = (int)qrCodeImage.rectTransform.sizeDelta.y;
        Texture2D t = VIPQRUtil.GenerateQRCode(content, wigth, height, texture);
        qrCodeImage.sprite = VIPConvertUtil.Texture2DToSprite(t,new Rect(0,0, wigth, height));
    }

}
